package com.appbee.cm.client.startup.impl;

import java.util.List;

import javax.inject.Inject;

import com.appbee.cm.client.startup.CMStartupLoader;
import com.appbee.cm.shared.data.ActivityEntryProxy;
import com.appbee.cm.shared.data.NavItemProxy;
import com.appbee.cm.shared.dataservice.DataRequest;
import com.appbee.core.client.startup.links.IStartupDataLoader;
import com.appbee.user.client.startup.IUserStartupLoader;
import com.appbee.user.shared.proxy.WebUserProxy;
import com.google.web.bindery.requestfactory.shared.Receiver;
import com.google.web.bindery.requestfactory.shared.Request;

public class CMStartupLoaderImpl implements CMStartupLoader,
		IUserStartupLoader, IStartupDataLoader
{

	private final DataRequest dataRequest;

	@Inject
	public CMStartupLoaderImpl(DataRequest dataRequest)
	{
		this.dataRequest = dataRequest;
	}

	@Override
	public Request<WebUserProxy> getCurrentUser(String destinationURL)
	{
		return dataRequest.getCurrentUser(destinationURL);
	}

	@Override
	public Request<List<NavItemProxy>> findNavItems()
	{
		return dataRequest.findNavItems();
	}

	@Override
	public Request<List<ActivityEntryProxy>> findActivityEntries()
	{
		return dataRequest.findActivityEntries();
	}

	@Override
	public void fire(Receiver<Void> receiver)
	{
		dataRequest.fire(receiver);
	}

}
